<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/StakeholderPortalTemplate.xhtml">
    <link href="./../resources/css/default.css" rel="stylesheet" type="text/css" />
    <link href="./../resources/css/tableLayout.css" rel="stylesheet" type="text/css" />
    <ui:define name="left">
        <table>
            <tr>
                <td><a id="addBranchLink" href="AddBranch.xhtml"><font color="#43C6DB">#{bundle['index.addbranch.link']}</font></a></td>
            </tr>
            <tr>
                <td><a id="viewBranchLink" href="ViewAllBranch.xhtml"><font color="#43C6DB">#{bundle['index.viewallbranch.link']}</font></a></td>
            </tr>
        </table>
    </ui:define>
    <ui:define name="content">

        <f:view beforePhase="#{deleteBranchManagedBean.initView}">
            <h:body>
                <h:form id="deleteBranchForm" prependId="false">
                    <p:panel id="panelDeleteBranch" header="#{bundle['branch.deletebranchdetails.panel']}">
                        <p:messages id="statusMessages" />
                        <p:tabView id="branchDeleteBranchDetailsTabView" dynamic="false">
                            <p:tab id="branchContactInformationTab" title="#{bundle['branch.contactinfo.tab']}">
                                <h:panelGrid columns="2" cellpadding="10">
                                    <h:outputLabel id="branchNameLabel" style="font-weight: bold" value="#{bundle['branch.name.label']}:" />
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.branchName}" />

                                    <h:outputLabel id="branchStreetNameLabel" style="font-weight: bold" value="#{bundle['branch.streetname.label']}:" />
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.branchAddress.streetName}" />

                                    <h:outputLabel id="branchUnitNumberLabel" style="font-weight: bold" value="#{bundle['branch.unitnumber.label']}:" />
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.branchAddress.unitNumber}" />

                                    <h:outputLabel id="branchBlockNumberLabel" style="font-weight: bold" value="#{bundle['branch.blocknumber.label']}:" />
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.branchAddress.houseNumber}" />

                                    <h:outputLabel id="branchBuildingNameLabel" style="font-weight: bold" value="#{bundle['branch.buildingname.label']}:" />
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.branchAddress.buildingName}" />

                                    <h:outputLabel id="branchPostalCodeLabel" style="font-weight: bold" value="#{bundle['branch.postalcode.label']}:" />
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.branchAddress.postalCode}" />

                                    <h:outputLabel id="branchContactNumberLabel" style="font-weight: bold" value="#{bundle['branch.contactnumber.label']}:" />  
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.contactNumber}" />  

                                    <h:outputLabel id="branchContactPersonLabel" style="font-weight: bold" value="#{bundle['branch.contactperson.label']}:" />
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.contactPerson}" />

                                    <h:outputLabel id="branchEmailAddressLabel" style="font-weight: bold" value="#{bundle['branch.emailaddress.label']}:" />
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.emailAddress}" />

                                </h:panelGrid>
                            </p:tab>

                            <p:tab id="branchNatureOfBusinessTab" title="#{bundle['branch.natureofbusiness.tab']}">
                                <h:panelGrid columns="2" cellpadding="10">
                                    <h:outputLabel id="branchCuisineTypesLabel" style="font-weight: bold" value="#{bundle['branch.cuisinetypes.label']}:" /> 
                                    <p:dataTable var="branchCuisineType" value="#{deleteBranchManagedBean.cuisinePrefToEdit}" >  
                                        <p:column style="width:200px" >
                                            <h:outputLabel value="#{branchCuisineType.cuisineTypeEnum}" converter="cuisineTypeConverter" />
                                        </p:column>
                                    </p:dataTable>

                                    <h:outputLabel id="branchFnbTypeLabel" style="font-weight: bold" value="#{bundle['branch.fnbtype.label']}:" />
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.fnBTypeEnum}" converter="fnbTypeConverter" />

                                    <h:outputLabel id="branchHalalTypeLabel" style="font-weight: bold" value="#{bundle['branch.halaltype.label']}:" />
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.isHalalEnum}" converter="halalTypeConverter"/>

                                    <h:outputLabel id="branchPriceRangeLabel" style="font-weight: bold" value="#{bundle['branch.pricerange.label']}:" />
                                    <h:outputLabel value="#{deleteBranchManagedBean.fnbBranchToEdit.priceRangeEnum}" converter="priceRangeConverter" />

                                </h:panelGrid>
                            </p:tab>

                            <p:tab id="branchOperatingHoursTab" title="#{bundle['branch.operatinghours.tab']}">

                                <p:dataTable style="width:200px" var="branchOperatingHours" value="#{deleteBranchManagedBean.branchOperatingHoursToEdit}" >  
                                    <p:column headerText="#{bundle['branch.operatingday.headerText']}" style="width:200px" >
                                        <h:outputLabel value="#{branchOperatingHours.operatingDayEnum}" converter="operatingDayConverter"/>
                                    </p:column>
                                    <p:column headerText="#{bundle['branch.openinghours.headerText']}" style="width:200px" >
                                        <h:outputLabel value="#{branchOperatingHours.openingHoursEnum}" converter="operatingHoursConverter" />
                                    </p:column>

                                    <p:column headerText="#{bundle['branch.closinghours.headerText']}" style="width:200px" >
                                        <h:outputLabel value="#{branchOperatingHours.closingHoursEnum}" converter="operatingHoursConverter" />
                                    </p:column>
                                </p:dataTable>

                                <h:panelGrid columns="2" cellpadding="10">
                                    <h:outputLabel id="branchOperatingHoursRemarksLabel" style="font-weight: bold" value="#{bundle['branch.operatinghoursremarks.label']}:"/>
                                    <p:inputTextarea disabled="true" id="branchOperatingHoursInputTextArea" style="width:300px;height:100px;" effectDuration="400" value="#{deleteBranchManagedBean.operatingHoursRemarksToEdit.remarks}"/>  
                                </h:panelGrid>
                            </p:tab>

                            <p:tab id="branchExtendedOperatingHoursTab" title="#{bundle['branch.extendedoperatinghours.tab']}">
                                <h:panelGrid columns="7" cellpadding="10">
                                    <p:dataTable var="branchExtendedDate" value="#{deleteBranchManagedBean.extendedOperatingHoursList}" id="branchExtendedDateDataTable">  

                                        <p:column headerText="#{bundle['branch.extendeddate.label']}" >
                                            <h:outputText value="#{branchExtendedDate.specificDate}" >
                                                <f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="GMT+8:00" />
                                            </h:outputText>
                                        </p:column>

                                        <p:column headerText="#{bundle['branch.extendedoperatingday.label']}" >
                                            <h:outputText value="#{branchExtendedDate.operatingDayEnum}" converter="operatingDayConverter"/>  
                                        </p:column>

                                        <p:column headerText="#{bundle['branch.extendedstarttime.label']}">
                                            <h:outputText value="#{branchExtendedDate.openingHoursEnum}" converter="operatingHoursConverter" />  
                                        </p:column>

                                        <p:column headerText="#{bundle['branch.extendedendtime.label']}">
                                            <h:outputText value="#{branchExtendedDate.closingHoursEnum}" converter="operatingHoursConverter" />  
                                        </p:column>
                                    </p:dataTable>

                                </h:panelGrid>
                            </p:tab>

                        </p:tabView>

                        <p:ajaxStatus style="width:16px;height:16px;">
                            <f:facet name="start">
                                <h:graphicImage value="/images/ajaxloading.gif" />
                            </f:facet>
                            <f:facet name="complete">
                                <h:outputText value="" />
                            </f:facet>
                        </p:ajaxStatus>

                        <p:commandButton id="branchDeleteButton" ajax="true" value="#{bundle['branch.delete.button']}" onclick="confirmation.show()"/>

                        <p:confirmDialog message="#{bundle['branch.confirmationdelete.dialogmessage']}" showEffect="bounce" hideEffect="explode" header="#{bundle['branch.confirmationdelete.dialogmessage']}" severity="alert" widgetVar="confirmation">  
                            <p:commandButton value="#{bundle['branch.confirmyes.button']}" oncomplete="confirmation.hide()" actionListener="#{deleteBranchManagedBean.deleteBranch}" />  
                            <p:commandButton value="#{bundle['branch.confirmcancel.button']}" onclick="confirmation.hide()" type="button" />
                        </p:confirmDialog>  
                    </p:panel>                               
                </h:form>
            </h:body>
        </f:view>
    </ui:define>
</ui:composition>
